Consider what steps you would have to take if you wanted to see which parts of AZ do not have a hospital with inpatient labor and delivery (L&D) units within a 45-minute drive.
Obtain a list of hospitals with L&D.
Geocode hospital addresses.
Determine a 45-minute radius around each hospital.
Obtain AZ geographic boundaries.
Visualize the results.
Set Up
Package
Purpose
jsonlite
Query CMS API to obtain data on hospitals
tidygeocoder
Geocode hospital addresses
dplyr
Wrangle data
stringr
Use text to filter data
tigris
Download Census Bureau TIGER/Line geographic boundaries
sf
Manipulate geosptial data
hereR
Query HERE API to determine 45-minute driving radius
mapview
Visualize geospatial data quickly
leaflet
Generate interactive geospatial visualizations
To help query the HERE API, there is one user-defined tryLocation() function to source. This function is courtesy of Hannah Recht.
Step 1
Obtain a list of AZ hospitals with L&D from the CMS Provider Data Catalog. Determine which hospitals do not have L&D.
facility_id facility_name
1 30002 BANNER - UNIVERSITY MEDICAL CENTER PHOENIX
2 30002 BANNER - UNIVERSITY MEDICAL CENTER PHOENIX
3 30002 BANNER - UNIVERSITY MEDICAL CENTER PHOENIX
4 30002 BANNER - UNIVERSITY MEDICAL CENTER PHOENIX
5 30002 BANNER - UNIVERSITY MEDICAL CENTER PHOENIX
6 30002 BANNER - UNIVERSITY MEDICAL CENTER PHOENIX
address citytown state zip_code countyparish telephone_number
1 1111 EAST MCDOWELL ROAD PHOENIX AZ 85006 MARICOPA (602) 839-2000
2 1111 EAST MCDOWELL ROAD PHOENIX AZ 85006 MARICOPA (602) 839-2000
3 1111 EAST MCDOWELL ROAD PHOENIX AZ 85006 MARICOPA (602) 839-2000
4 1111 EAST MCDOWELL ROAD PHOENIX AZ 85006 MARICOPA (602) 839-2000
5 1111 EAST MCDOWELL ROAD PHOENIX AZ 85006 MARICOPA (602) 839-2000
6 1111 EAST MCDOWELL ROAD PHOENIX AZ 85006 MARICOPA (602) 839-2000
measure_id
1 PC_01
2 PC_05
3 SM_7
4 ePC_02
5 ePC_07a
6 ePC_07b
measure_name
1 Elective Delivery
2 Exclusive Breast Milk Feeding
3 Maternal Morbidity Structural Measure
4 Cesarean Birth
5 Risk Adjusted Severe Obstetric Complications (All)
6 Risk Adjusted Severe Obstetric Complications (excluding blood-transfusion-only cases)
score sample footnote start_date end_date
1 1 109 2 01/01/2023 12/31/2023
2 Not Available Not Available 5 01/01/2023 12/31/2023
3 Yes Not Applicable 01/01/2023 12/31/2023
4 Not Available Not Available 5 01/01/2023 12/31/2023
5 Not Available Not Available 5 01/01/2023 12/31/2023
6 Not Available Not Available 5 01/01/2023 12/31/2023
facility_id facility_name
1 30010 ST. MARY'S HOSPITAL
2 30014 HONOR HEALTH JOHN C. LINCOLN MEDICAL CENTER
3 30030 ABRAZO CENTRAL CAMPUS
4 30037 TEMPE ST LUKES HOSPITAL
5 30038 HONORHEALTH SCOTTSDALE OSBORN MEDICAL CENTER
6 30061 BANNER BOSWELL MEDICAL CENTER
Step 2
Geocode the hospitals addresses and turn into a geospatial dataset.